package com.test.pdproject.service.rabbitservice;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @ClassName lisaisai
 * @Descirption 测试消息发送
 * @Author Administrator
 * @Date 2018/9/19 13:50
 * @Version 1.0
 **/
@Component
public class HelloSender {
    @Autowired
    private AmqpTemplate rabbitTemplate;

    public void sendProduct(String product) {
        System.out.println("Sender : " + product);
        this.rabbitTemplate.convertAndSend("product", product);
    }
    public void sendOrder(String order) {
        System.out.println("Sender : " + order);
        this.rabbitTemplate.convertAndSend("order", order);
    }
    public void sendSku(String sku) {
        System.out.println("Sender : " + sku);
        this.rabbitTemplate.convertAndSend("sku", sku);
    }
}
